<!DOCTYPE html>
<html>

<head>
    <meta charset="utf-8">
    <title>检测对象类型</title>
</head>

<body>
    <p></p>
    <script>
        /*变量的结构赋值*/
        //数组的结构赋值
        let [a, b, c, d] = [1, 2, 3, 5];
        console.log(a, b, c, d); // 1 2 3 4 5
        /*对象的结构赋值*/
        /*let {name,age}={name:'小明',age:20};
        console.log(name,age);*/
        // 对象属性别名
        let {
            name: firstName,
            age
        } = {
            name: '小明',
            age: 20
        };
        console.log(firstName, age); // 小明 20
        let {
            sin,
            cos
        } = Math;
        console.log(typeof sin); // fucntion
        console.log(typeof cos); // function
        /*字符串的结构赋值*/
        let [h, g, j] = 'jefiwi';
        console.log(h, g, j); // j e f
    </script>
</body>

</html>